package jrain.fw.dao.common.handler;

import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import jrain.fw.core.dao.handler.IResultSetHandler;

public class RowMapListHandler implements IResultSetHandler<List<Map<String, Object>>> {

	
	public List<Map<String, Object>> handle(ResultSet rs, Map<String, Object> mapper) throws SQLException {
		List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
		ResultSetMetaData rsmd = rs.getMetaData();
		int cols = rsmd.getColumnCount();
		// 获取系统列信息
		while (rs.next()) {
			Map<String, Object> rowMap  = RowMapHandler.handle1(rsmd, cols, rs, mapper);
			rows.add(rowMap);
		}
		return rows;
	}
}